import request from '@/utils/request'

// 查询盘库关联列表
export function listRelate(query) {
  return request({
    url: '/inventory/relate/list',
    method: 'get',
    params: query
  })
}

// 查询盘库关联详细
export function getRelate(checkGoodsId) {
  return request({
    url: '/inventory/relate/' + checkGoodsId,
    method: 'get'
  })
}

// 新增盘库关联
export function addRelate(data) {
  return request({
    url: '/inventory/relate',
    method: 'post',
    data: data
  })
}

// 修改盘库关联
export function updateRelate(data) {
  return request({
    url: '/inventory/relate',
    method: 'put',
    data: data
  })
}

// 删除盘库关联
export function delRelate(checkGoodsId) {
  return request({
    url: '/inventory/relate/' + checkGoodsId,
    method: 'delete'
  })
}

// 新增盘库关联
export function addRelateExt(data, checkGoodsId) {
  return request({
    url: '/inventory/relate/ext/' + checkGoodsId,
    method: 'post',
    data: data
  })
}

// 删除盘库关联
export function delRelateExt(goodsIds, checkGoodsId) {
  return request({
    url: '/inventory/relate/ext/' + goodsIds + '/' + checkGoodsId,
    method: 'delete'
  })
}

// 盘库接口
export function checkRelateExt(data, checkGoodsId) {
  return request({
    url: '/inventory/relate/check/' + checkGoodsId,
    method: 'post',
    data: data
  })
}


